<?php
declare(strict_types=1);
namespace App\One;
use App\Controller;
use Field\OneCampaignGroupConst;

// hook controller_one_search_campaign_group_use.php

/**
 * @title   计划组
 * @auth    true
 * @login   true
 * @menu    false
 * @component   vlist/index.vue
 * @icon    el-icon-menu
 * @active  true
 * @affix   false
 * @rank    99
 */
class AdGroup extends Controller
{
    // hook controller_one_search_campaign_group_public_start.php



    // hook controller_one_search_campaign_group_public_end.php

    /**
     * @title  下发配置
     * @rank    0
     */
    public function action_Conf_PUT()
    {
        // hook controller_one_search_campaign_group_conf_start.php
        $conf=['groupTotalRow'=>'bottom','grandTotalRow'=>'bottom','pageSize'=>10000,'remoteSort'=>0,'remoteFilter'=>0,'remoteSummary'=>0,'hidePagination'=>1,'hideRefresh'=>0,'hideDo'=>0,'add'=>0,'start'=>0,'stop'=>0,'delete'=>0,'import'=>0,'export'=>0,'pageSizes'=>[10,20,25,50,100,500,1000,10000],'TreeData'=>0,'Local'=>1,'enable'=>0,'disable'=>0,'chartRange'=>0,'copy'=>0,
            'merge'=>[
                'CampaignGroup'=>['k'=>'campaignGroupId','v'=>'campaignGroupName'],
                'Campaign'=>['k'=>'campaignId','v'=>'campaignName'],
            ]
        ];
        $Columns = [
            ['prop' => 'campaignGroupName', 'label' => '计划组', 'hidden' => 0, 'sortable' => 1,'pinned'=>'left'],
            ['prop' => 'campaignName', 'label' => '计划', 'hidden' => 0, 'sortable' => 1,'pinned'=>'left'],
            ['prop'=>'adgroupName','label'=>'主体','hidden'=>0,'sortable'=>1,'pinned'=>'left','aggFunc'=>'合计'],
            ['prop'=>'imgUrl','label'=>'主图','hidden'=>0,'width'=>80,'sortable'=>1,'type'=>'image','pinned'=>'left','aggFunc'=>'合计'],
            ['prop'=>'campaignGroupId','label'=>'计划组ID','width'=>'80px','hidden'=>0,'sortable'=>1],
            ['prop'=>'campaignId','label'=>'计划ID','width'=>'80px','hidden'=>0,'sortable'=>1],
            ['prop'=>'adgroupId','label'=>'主体ID','width'=>'80px','hidden'=>0,'sortable'=>1],
        ];
        array_push($Columns,...$this->public_columns) ;
        $Filter = [];
        $Tools = [];

        // hook controller_one_search_campaign_group_conf_end.php
        $this->response('0000', ['Conf' =>$conf, 'Filter' => $Filter, 'Tools' =>$Tools, 'Columns' => $Columns]);
    }


    /**
     * @title  下发启停配置
     * @rank    0
     */
    public function action_Aiprice_PUT()
    {
        $BizCode = $this->request->param('BizCode','');
        $data=[
            [
                'span'=>24,
                'formItems'=> [
                    ['prop'=>'mode','label'=>'出价方式','span'=>24,'component'=>'radioGroup','options'=>['all'=>0,'items'=>['custom'=>'指定限额','current'=>'当前限额']]],
                    ['prop'=>'bidType','label'=>'调整方式','span'=>12,'component'=>'radioGroup','options'=>['all'=>0,'parent'=>'mode','items'=>[
                        'current'=>['quantity'=>'按数值','rate'=>'按百分比'],
                    ]]],
                    ['prop'=>'num','label'=>'指定数值','span'=>12,'component'=>'input',],
                ]
            ],
        ];
        $config=[

        ];
        $this->response('0000', ['BizCode' =>$BizCode,'data'=>$data,'config'=>$config]);
    }

    //
    // hook controller_one_search_campaign_group_end.php
}

?>